package com.myx.design.single.other;

/**
 * 描述:枚举测试
 * 枚举本身是单例的，一般用于项目中定义常量
 * @author: myx
 * @date: 2018/11/28
 * Copyright © 2018-hotpot. All rights reserved.
 */
public enum EnumTest {
    HTTP_200(200, "请求成功"),HTTP_500(500,"请求失败");
    private Integer code;
    private String name;
    EnumTest(Integer code, String name){
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static void main(String[] args) {
        System.out.println(EnumTest.HTTP_200.getName());
        System.out.println(EnumTest.HTTP_500.getName());
    }
}
